package cn.gson.springboot.model.service;

import cn.gson.springboot.model.dao.InventoryFlowDao;
import cn.gson.springboot.model.mapper.InventoryFlowMapper;
import cn.gson.springboot.model.mapper.InventoryMapper;
import cn.gson.springboot.model.pojos.InventoryFlow;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class InventoryFlowService {
    @Autowired
    InventoryFlowMapper invFlowMapper;
    @Autowired
    InventoryFlowDao invFlowDao;
    public List<InventoryFlow> selectInvFlow(Integer warId,Integer value,Integer num,String content){
        return invFlowMapper.selectInvFlow(warId,value,num,content);
    }

    @Transactional(transactionManager = "transactionManager")
    public void saveInventoryFlow(InventoryFlow inventoryFlow){
        invFlowDao.save(inventoryFlow);
    }

    @Transactional(transactionManager = "transactionManager")
    public void deleteInventoryFlow(Integer invFlowId){
        invFlowDao.existsById(invFlowId);
    }
}
